rolesystem.roles.game
Class Manager

java.lang.Object
  extended by rolesystem.roles.game.Manager

public abstract class Manager
extends java.lang.Object

This role is the manager of a generic game. Keywords: game, manager.


Field Summary
static KnownEvent KE_askKind
          A player asks the kind of the game.
static KnownEvent KE_giveUp
          A player gives up the current game.
static KnownEvent KE_Move
          A player makes a move.
static KnownEvent KE_reqPlay
          A player requests to play.
static java.lang.String ROLE_ID
          Role identifier.
 
Constructor Summary
Manager()
           
 
Method Summary
static RoleAction accept(int addressee)
          Notifies to a player that it can play.
static RoleAction gameLost(int addressee)
          Notifies to a player that it has lost the game.
static RoleAction gameOver(int addressee)
          Notifies that the game is over.
static RoleAction gameWon(int addressee)
          Notifies to a player that it has won the game.
static RoleAction notifyKind(int addressee, java.lang.String content)
          Notifies the kind of the game.
static RoleAction notifySituation(int addressee, java.io.Serializable content)
          Notifies the current situation of the game.
static RoleAction refuse(int addressee)
          Notifies to a player that it cannot play.
static RoleAction refuseMove(int addressee)
          Refuse the move of a player.
static RoleAction requestMove(int addressee)
          Requests to a player to make its move.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE_ID

public static final java.lang.String ROLE_ID
Role identifier.

See Also:
Constant Field Values

KE_askKind

public static final KnownEvent KE_askKind
A player asks the kind of the game. Sender role: Player


KE_reqPlay

public static final KnownEvent KE_reqPlay
A player requests to play. Sender role: Player


KE_Move

public static final KnownEvent KE_Move
A player makes a move. Sender role: Player Content: Move.


KE_giveUp

public static final KnownEvent KE_giveUp
A player gives up the current game. Sender role: Player

Constructor Detail

Manager

public Manager()
Method Detail

notifyKind

public static RoleAction notifyKind(int addressee,
                                    java.lang.String content)
Notifies the kind of the game.

Parameters:
addressee - Player
content - Kind of the game.

accept

public static RoleAction accept(int addressee)
Notifies to a player that it can play.

Parameters:
addressee - Player

refuse

public static RoleAction refuse(int addressee)
Notifies to a player that it cannot play.

Parameters:
addressee - Player

notifySituation

public static RoleAction notifySituation(int addressee,
                                         java.io.Serializable content)
Notifies the current situation of the game.

Parameters:
addressee - Player
content - Situation of the game.

requestMove

public static RoleAction requestMove(int addressee)
Requests to a player to make its move.

Parameters:
addressee - Player

refuseMove

public static RoleAction refuseMove(int addressee)
Refuse the move of a player.

Parameters:
addressee - Player

gameWon

public static RoleAction gameWon(int addressee)
Notifies to a player that it has won the game.

Parameters:
addressee - Player

gameLost

public static RoleAction gameLost(int addressee)
Notifies to a player that it has lost the game.

Parameters:
addressee - Player

gameOver

public static RoleAction gameOver(int addressee)
Notifies that the game is over.

Parameters:
addressee - Player